const Koa = require('koa');
const app = new Koa();
const res_duration  = require('./middleware/res_duration')
const res_data  = require('./middleware/res_data')
const res_header  = require('./middleware/res_header')

app.use(res_duration)
app.use(res_header)
app.use(res_data)

app.listen(3000)

// 开启服务端的监听, 监听客户端的连接
// 当某一个客户端连接成功之后, 就会对这个客户端进行message事件的监听
const webSocketService = require('./service/web_socket_service')
webSocketService.listen()